package com.zheng.shop.rpc.api;

import com.zheng.common.base.BaseService;
import com.zheng.shop.common.exception.ShopException;
import com.zheng.shop.dao.model.ShopDict;

import java.util.List;

/**
 * ShopDictService接口
 * Created by shuzheng on 2017/11/7.
 */
public interface ShopDictService extends BaseService<ShopDict> {

    ShopDict getDictByValue(String value, String key);

    ShopDict getDictByName(String Name, String key);

    String getDictName(String value, String key, String defaultValue);

    List<String> getDictNames(String[] values, String key);

    String getDictValue(String name, String key, String defaultName);

    List<ShopDict> getDictList(String key);

    //获取最大的排序
    int selectMaxSort();

    //创建dict（多个）
    boolean createDict(String dicts) throws ShopException;

    //修改dict（多个，先删除再重新创建）
    boolean updateDict(List<ShopDict> dicts, String oldKey) throws ShopException;

    int selectDictCount(String search);

    boolean deleteBatchDict(List<Integer> ids) throws ShopException;
}